/*
 * Copyright 2016-2017 TVI Go Easy.
 * Created on 2017/4/29 23:07
 */
package org.mechanic.fund.domain.wechat;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.mechanic.fund.domain.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * 微信公众平台基本信息(公众号、企业号、小程序)
 *
 * @author mechanic
 * @version 0.0.1
 */
@Entity
@Table(name = "wc_base_info")
public class WcBaseInfo extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 2119913870139704678L;
    /**
     * 公众号名称
     */
    @Column(name = "name")
    private String name;
    /**
     * 公众号ID。对应企业号的CorpId，小程序的appId
     */
    @Column(name = "mp_id")
    @JsonIgnore
    private String mpId;
    /**
     * 公众号密钥(需要根管理组的密钥)
     */
    @Column(name = "secret")
    @JsonIgnore
    private String secret;
    /**
     * 公众号类型。1=订阅号，2=服务号，3=企业号，4=小程序
     */
    @Column(name = "type")
    private Integer type;
    /**
     * 应用回调的token。
     */
    @Column(name = "app_token")
    @JsonIgnore
    private String appToken;
    /**
     * 应用回调的key
     */
    @Column(name = "app_encoding_aeskey")
    @JsonIgnore
    private String appEncodingAESKey;
    /**
     * 是否通过微信官方认证
     */
    @Column(name = "is_authc")
    private Integer isAuthc;
    /**
     * 公众号二维码
     */
    @Column(name = "qrcode")
    private String qrcode;
    /**
     * 描述
     */
    @Column(name = "description")
    private String description;

    public WcBaseInfo() {
    }

    public WcBaseInfo(
      String name,
      String mpId,
      String secret,
      Integer type,
      String appToken,
      String appEncodingAESKey,
      Integer isAuthc,
      String qrcode,
      String description) {
        super();
        this.name = name;
        this.mpId = mpId;
        this.secret = secret;
        this.type = type;
        this.appToken = appToken;
        this.appEncodingAESKey = appEncodingAESKey;
        this.isAuthc = isAuthc;
        this.qrcode = qrcode;
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMpId() {
        return mpId;
    }

    public void setMpId(String mpId) {
        this.mpId = mpId;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getAppToken() {
        return appToken;
    }

    public void setAppToken(String appToken) {
        this.appToken = appToken;
    }

    public String getAppEncodingAESKey() {
        return appEncodingAESKey;
    }

    public void setAppEncodingAESKey(String appEncodingAESKey) {
        this.appEncodingAESKey = appEncodingAESKey;
    }

    public Integer getIsAuthc() {
        return isAuthc;
    }

    public void setIsAuthc(Integer isAuthc) {
        this.isAuthc = isAuthc;
    }

    public String getQrcode() {
        return qrcode;
    }

    public void setQrcode(String qrcode) {
        this.qrcode = qrcode;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
